package api

import (
	"gitee.com/go-mid/booter/bootservice"
)

func WithInterceptor(hander bootservice.HandlerFunc, preInterceptors []bootservice.HandlerFunc, postInterceptors []bootservice.HandlerFunc) (funcs []bootservice.HandlerFunc) {
	for _, v := range preInterceptors {
		funcs = append(funcs, v)
	}
	funcs = append(funcs, hander)
	for _, v := range postInterceptors {
		funcs = append(funcs, v)
	}
	return
}
